Imgur
source: http://personal.tcu.edu/kylewalker/immigrant-america | Mapping Immigrant America
This week’s lab will feature exploration of the following:
In this first lab, we will review the core components of the Field Calculator - an integral QGIS tool that we will revisit with frequency throughout the course. Familiarity now will increase your effectiveness later.
In the class 2 assignment, we utilized the Field Calculator to create new fields for geometry ($area) and a rate based on the $area field. In this review, we will create a new column for length of each railroad segment in kilometers.
Before proceeding, its important to understand how QGIS understands units for geometry calculations. By default, meters are utilized based on an ellisoid (curved surface) . We can check this QGIS > Project > Project Preferences > General > Measurements. In effect, the $length calculation will result in a value measured in meters.
railroads.shp that represents railroad alignments in North America. Point to the data and import as a vector feature:Create New Field - typically you will want to do this. You can also Update an Existing Field or Create Virtual Field - which creates a temporary field typically used for compound calculations.
Output Field Name - keep short and simple. Here its simply length + km for kilometer unit.
Output Field Type - determines the field type. Whenever calculating geometry, you will want a decimal number (real).
Output Field Length and Precision - defaults to 10/3 which will handle most scenarios Here a field width of 10 and a field precision of 3 means 6 digits before the dot, then the dot itself (1) and another 3 digits for the precision.
Selected Function Helper - choose the Geometry option, dropdown to $length and populate in 6 - Expression Editor.
Expression Editor - in order to produce the units in kilometers, divide $length by 1000 (meters/1000 = kilometers)
Check the attribute result. There should now be a field length_km populated with kilometers per railroad, i.e. the length of each railroad in the feature layer. If you produce a mistake, you can easily delete the error field and start over by click on the delete field icon in the attribute view, and then selecting which field to delete in the tool dialog box:
In this second lab, we will explore a thematic mapping technique that can be used effectively for categorical mapping at various scales. Here, ‘dots’ represents certain proportions of a quality across 1 or more type classes.
The theme of the mapping is Majority Population and Minority Populations for U.S. States, 2017. In the dataset, there are columns for each; and then columns for those populations divided by 10,000. This results in a variable that can be shown as ‘1 dot = 10,000 people’.
This technique is known as ‘dot density mapping’. These maps display dot density in a randomized distribution. Random points are used to create a dot density map within polygon features. Proportionality is integral to the dot density technique. Here 1 dot on the map will represent x number of variable occurrences. Exact location is sacrificed and replaced with generalized densities.
This technique is very effective when utilized with a categorical value across limited (smaller, 2 - 5 classes, typically).
To start, download the data, unzip to the working drive:
Download Class 3 Lab 2 Data
Inside the data folder find the following:
states.2017.shpNext, import the states.2017.shp into a working QGIS project.
Symbolize states so that that they are a transparent fill with a simple label for the State field:
Note: its important to run dot density mapping within polygon features that are projected; that is, they are not in an unprojected coordinate system like
WGS84. The reasoning here is that the points need to be distributed randomly based on distance within the polygons, and a projected coordinate system is important for this process. Currentlystates.2017.shpis indeed projected toNorth_America_Albers_Equal_Area_Conic.
min.10k):Run the tool, producing a temporary layer.
Again, Continue to the GIS processing for Random Points Inside Polygons. When populating the tool this second time, point points count option to maj.10k to represent the majority population per state divided by 10,000:
Note: is the map above, the Majority population is symbolized as dark green, and Minority population as magenta.
source: https://zola.planning.nyc.gov/about/
| Code | Description | Hex_Code |
|---|---|---|
| 01 | One & Two Family Buildings | feff9e |
| 02 | Multi-Family Walk-Up Buildings | fcaf3a |
| 03 | Multi-Family Elevator Buildings | a86300 |
| 04 | Mixed Residential & Commerical Buildings | ff7839 |
| 05 | Commercial & Office Buildings | fc2525 |
| 06 | Industrial & Manufacturing | df57fa |
| 07 | Transportation & Utility | dcb6e8 |
| 08 | Public Facilities & Institutions | 3c99cf |
| 09 | Open Space & Outdoor Recreation | 6dcc66 |
| 10 | Parking Facilities | b1afad |
| 11 | Vacant Land | 4b4b4b |
.qml. You can make these .qml files by simply exporting them along with your feature exports:To Begin this short lab, navigate to the assignment data and import the shapefile for the NYC land use parcel data into a QGIS project.
Inside the data folder find the following:
MapPLUTO.shp.qml file; its should reside near/within the project data folder:.qml file does not import in the Layers Panel; rather it is ‘attached’ within the .shp. To do this process, symbology is applied to the layer by referencing the .qml file. To do this, within MapPLUTO.shp, navigate to Properties > Symbology > Categorized and choose LandUse as the value..qml file in the lyr.style folder: